Field of the Invention
The present invention relates to a machining program creating device for keyway milling for a wire electric discharge machine.
Description of the Related Art
Conventionally, a special machine such as a slotter (or slotting machine) has been used to machine a keyway on the side surface of a round hole in a workpiece. The slotter is a cutting machine in which a ram with a cutting tool vertically reciprocates to machine the inner surface of the hole. Since the slotter is a kind of special-purpose machine using the single cutting tool, it has a problem that its machining efficiency is low. Since the cutting tool used must be provided for each of different keyway sizes, moreover, the productivity of the slotter is also low or insufficient.
In recent years, some attempts have been made to use general-purpose machines for machining such as keyway milling, in order to improve productivity. To this end, there is a promising method in which a keyway is machined on the side surface of a round hole in a workpiece by using a wire electric discharge machine as a general-purpose machine.
Japanese Patent Application Laid-Open No. 8-153132 discloses a CAD/CAM device provided with keyway defining means configured to input the shapes of a keyway and a key for securing a component to a component mounting hole. A figure can be automatically drawn by only selecting the component mounting hole defined by the keyway defining means and inputting parameters. In this way, the CAD/CAM device can generate NC data for keyway milling.
However, many operators accustomed to use special-purpose machines may be unfamiliar with the operation of a general-purpose machine or poor at creating a machining program for running the general-purpose machine. Thus, there is a problem that the productivity cannot be improved as expected. In machining a keyway on the side surface of a round hole in a workpiece by means of a wire electric discharge machine, for example, the following steps of operation are conventionally required:                (a) the workpiece with the round hole is set on the machine,        (b) upper and lower nozzles supporting a wire electrode are moved to an arbitrary position in the round hole,        (c) the wire electrode is connected,        (d) the diameter and center position of the round hole are obtained by means of a positioning function of the wire electric discharge machine,        (e) the upper and lower nozzles are moved to a machining start point in the round hole,        (f) a machining program starting at the machining start point is created in consideration of the diameter and center position of the round hole and the size of the keyway, and        (g) a start button for electric discharge machining is depressed.        
It is very time-consuming for operators unfamiliar with the wire electric discharge machine to perform the above steps of operation as initial setup and the productivity cannot be increased. Further, performing the keyway milling by using the wire electric discharge machine as a general-purpose machine also involves the following problems.
The problem of cutting a workpiece during wire electric discharge machining will be described with reference to FIGS. 15 and 16.
FIG. 15 shows how a wire electrode 2 receives a force opposite to a wire advancing direction 6 in a case where a machined surface 4a and a machining path 8 extend perpendicular to each other as a workpiece 4 is cut.
FIG. 16 shows how the wire electrode 2 is deviated from the machining path 8 in a case where the machined surface 4a and the machining path 8 do not extend perpendicular to each other as the workpiece 4 is cut. Reference numeral 10 in FIG. 15 and FIG. 16 schematically denotes electric discharges between the wire electrode 2 and the machined surface 4a. 
If the machined surface 4a and the machining path 8 are perpendicular to each other when the wire electrode 2 cuts into the workpiece 4 during the wire electric discharge machining, as shown in FIG. 15, the sum total (denoted by numeral 12) of a force of discharge repulsion produced in the wire electrode 2 and a force the wire electrode 2 receives from a working fluid acts in the direction opposite to the advancing direction of the wire electrode 2 along the machining path 8.
In contrast, if the machined surface 4a and the machining path 8 are not perpendicular to each other, as shown in FIG. 16, the sum total 12 of the force of discharge repulsion and the force received from the working fluid acts off the machining path 8, depending on the angle between the machined surface 4a and the machining path 8. Consequently, there arises a problem that the wire electrode 2 is deviated from the machining path 8 by the resultant force. This problem may sometimes cause a problem that the shape accuracy of an opening of a keyway to be machined is degraded and the opening becomes so narrow that a key 22 cannot be inserted into a keyway 14b (see FIG. 19). This problem may be caused in, for example, thick plate machining performed with increased discharge energy and amount of working fluid, though it seldom occurs in thin plate machining.
A conventional method for machining a keyway on the side surface of a round hole in a workpiece will now be described with reference to FIGS. 17 to 19.
In a case where the keyway 14b is machined in a round hole 15 in a workpiece 14 such as that shown in FIG. 17, a machining path 18 (represented by a dotted line) for the shortest machining distance is formed. In machining the keyway 14b on a machined surface 14a of the round hole 15 along the machining path 18, the above-described force acts on the wire electrode 2 so that the wire electrode 2 is deviated from the machining path (as indicated by an actual movement path 20 of the wire electrode 2 of FIG. 18), since the machined surface 14a and the machining path 18 do not extend perpendicular to each other. Consequently, a cut portion of the keyway 14b is shaped like a part 24 of FIG. 19, so that the width of a keyway opening inevitably becomes smaller than a width specified in a drawing or the like. Thus, there arises a problem that the key 22 shown in FIG. 19 cannot be inserted into the machined keyway 14b. 
According to the aforementioned technique disclosed in Japanese Patent Application Laid-Open No. 8-153132, the keyway defining means and keyway database registration means are provided so that the NC data for keyway milling can be generated. Since the NC data is generated without considering problems that may arise when an arc-shaped machined surface is subjected to wire electric discharge machining, however, there may arise a problem that the key cannot be inserted into the keyway. Further, no improvement in operability is achieved for operators who are accustomed to use special-purpose machines.
In order to solve the above problems on the productivity of the conventional technique, the keyway milling is expected to be achieved using the wire electric discharge machine by performing only three (steps of (a) setting the workpiece with the round hole on the machine, (b) moving the upper and lower nozzles supporting the wire electrode to an arbitrary position in the round hole, and (g) depressing the start button for electric discharge machining) of the above-described steps of operation.